﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;
using System.Threading.Tasks;
#if DOT_NET
using StyleMVVM.Data;

#else
using Windows.Foundation.Metadata;

#endif

namespace StyleMVVM.DependencyInjection
{
	/// <summary>
	/// During an injection the context contains information about the injection as well as extra data
	/// </summary>
	public interface IInjectionContext
	{
		IDisposalScope DisposalScope { get; set; }

		IInjectionTargetInfo Target { get; set; }

		bool IsConditionDefined(string condition);

		void DefineCondition(string condition);

		object GetConditionValue(string condition);

		void SetConditionValue(string condition, object newValue);

		[DefaultOverload]
		void RegisterExport(string exportName, ExportFunction exportFunction);

		void RegisterExport(Type exportType, ExportFunction exportFunction);

		void RegisterExport(Type exportType, object instance);

		void RegisterExport(string exportName, object instance);

		[DefaultOverload]
		object LocateExport(string exportName,
								  IDependencyInjectionContainer container,
								  [ReadOnlyArray] object[] constructorParams);

		object LocateExport(Type exportType,
								  IDependencyInjectionContainer container,
								  [ReadOnlyArray] object[] constructorParams);

		object GetCustomData(string customDataName);

		void SetCustomData(string customDataName, object newData);
	}

	public interface IDisposableInjectionContext : IInjectionContext, IDisposable
	{

	}
}